package com.yupi.yuoj.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yuoj.model.dto.content.ContentQueryRequest;
import com.yupi.yuoj.model.entity.ContentCollection;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yuoj.model.entity.User;
import com.yupi.yuoj.model.vo.ContentVO;

/**
* @author admin
* @description 针对表【content_collection(内容收藏表)】的数据库操作Service
* @createDate 2025-11-01 21:28:54
*/
public interface ContentCollectionService extends IService<ContentCollection> {

    /**
     * 收藏 / 取消收藏
     *
     * @param contentId
     * @param loginUser
     * @return
     */
    int doContentCollection(long contentId, User loginUser);

    /**
     * 分页获取用户收藏的内容列表
     *
     * @param page
     * @param contentQueryRequest
     * @param userId
     * @return
     */
    Page<ContentVO> listContentCollectionByPage(Page<Object> page, ContentQueryRequest contentQueryRequest, Long userId);

    /**
     * 封装了事务的方法
     *
     * @param userId
     * @param contentId
     * @return
     */
    int doContentCollectionInner(long userId, long contentId);

}
